package com.zifeng.feign;

import com.zifeng.common.R;
import com.zifeng.feign.fallback.OrderFeignClientFallback;
import com.zifeng.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "order-service", fallback = OrderFeignClientFallback.class)
public interface OrderFeignClient {

    @PostMapping("/addwithblock")
    public R addOrderWithBlock(@RequestBody Order order);

    @GetMapping(value = "/{id}")
    public R getOrder(@PathVariable("id") Long id);
}